from fastapi import APIRouter, Request

request_router = APIRouter()


@request_router.post('/post')
async def post(request: Request):
    host = request.client.host
    port = request.client.port
    url = request.url
    # session = request.session
    cookies = request.cookies
    user_agent = request.headers.get('User-Agent')
    print("host:", host)
    print("port:", port)
    print("url:", url)
    print("cookies:", cookies)
    print("user_agent:", user_agent)
    # print("session:", session)
    return {
        "host": host,
        "port": port,
        "url": url,
        "cookies": cookies,
        "user_agent": user_agent
        # "session": session
    }
